<script setup lang="ts">
	import { ref, onMounted, defineProps } from "vue";
	import ReCol from "@/components/ReCol";
  import { message } from "@/utils/message";
  import {
    categorySelectApi,
    partSelectApi,
    brandSelectApi,
    supplierSelectApi
  } from "@/api/quotedPriceApi";
  const props = defineProps(["formInline"]);
	const ruleFormRef = ref();
	const newFormInline = ref(props.formInline);
	function getRef() {
		return ruleFormRef.value;
	}
	defineExpose({ getRef });

  onMounted(()=> {
    console.log(newFormInline.value)
  })

</script>

<template>
	<el-descriptions
    class="margin-top"
    title=" "
    :column="2"
    border
	  >
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">

          产品名称
        </div>
      </template>
      {{newFormInline.productInfo.product?.productName || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          产品编号
        </div>
      </template>
      {{newFormInline.productInfo.product?.productNo || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          单据类型
        </div>
      </template>
      <div v-for="item in newFormInline.typeOption" :key="item.id">
        <span v-if="newFormInline.productInfo.type === item.id">{{item.name}}</span>
      </div>
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          入库单日期
        </div>
      </template>
      {{newFormInline.productInfo.purchaseOrder?.orderDate || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          入库单号
        </div>
      </template>
      {{newFormInline.productInfo.purchaseOrder?.orderNo || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          变化数量
        </div>
      </template>
      {{newFormInline.productInfo?.changeNum * 1 || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          仓库
        </div>
      </template>
      {{newFormInline.productInfo.store?.name || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          仓库编码
        </div>
      </template>
      {{newFormInline.productInfo.store?.code || '--'}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          创建人
        </div>
      </template>
       {{newFormInline.productInfo.createUser?.name}}
    </el-descriptions-item>
    <el-descriptions-item :span="2">
      <template #label>
        <div class="cell-item">
          创建时间
        </div>
      </template>
       {{newFormInline.productInfo.createdAt}}
    </el-descriptions-item>
  </el-descriptions>
</template>
<style scoped>

</style>
